package com.wql.rabbitmq.study;

import com.rabbitmq.client.Channel;
import com.wql.rabbitmq.ChannelFactory;
import com.wql.rabbitmq.Constant;

public class RoutingTestForProducter {

	public static void main(String[] args) throws Exception {
		Channel channel = ChannelFactory.getChannel();
		channel.exchangeDeclare(Constant.ROUTING_NAME, "direct");
		for (int i = 0; i < Constant.ROUTING_ROUTE.length; i++) {
			String msg = Constant.ROUTING_ROUTE[i] + "-msg";
			System.out.println("send msg " + msg);
			channel.basicPublish(Constant.ROUTING_NAME, Constant.ROUTING_ROUTE[i], null, msg.getBytes());
		}
	}

}
